package com.itboye.sunsun;

import com.itboye.sunsun.Application.App;
import com.itboye.sunsun.person.ui.CustomActivity;
import com.itboye.sunsun.person.ui.ManageLocationActivity;
import com.itboye.sunsun.person.ui.MyCollectActivity;
import com.itboye.sunsun.person.ui.MyOrderActivity;
import com.itboye.sunsun.person.ui.MyWealthActivity;
import com.itboye.sunsun.support.BaseFragment;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.webkit.WebView.FindListener;
import android.widget.RelativeLayout;
import android.widget.TextView;

@SuppressLint("ValidFragment")
public class MeFragment extends BaseFragment implements OnClickListener {

	private Context context;
	private View meView;
	private TextView viewAllOrder;
	private TextView mywealth;
	private TextView mylocation;
	private TextView mycollect;
	private RelativeLayout payrela;
	private RelativeLayout sendrela;
	private RelativeLayout receiverela;
	private RelativeLayout customrela;

	public MeFragment() {
	}

	public MeFragment(Context context) {
		this.context = context;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		meView = inflater.inflate(R.layout.fragment_me, container, false);
		smartInject(meView);
		return meView;
	}

	public void onClick(View v) {

		switch (v.getId()) {
		case R.id.viewAllOrder:
			Intent intent0 = new Intent();
			intent0.setClass(App.ctx, MyOrderActivity.class);
			intent0.putExtra("fragmentCurrent", 0);
			startActivity(intent0);
			break;
		case R.id.payrela:
			Intent intent1 = new Intent();
			intent1.setClass(App.ctx, MyOrderActivity.class);
			intent1.putExtra("fragmentCurrent", 1);
			startActivity(intent1);
			break;
		case R.id.sendrela:
			Intent intent2 = new Intent();
			intent2.setClass(App.ctx, MyOrderActivity.class);
			intent2.putExtra("fragmentCurrent", 2);
			startActivity(intent2);
			break;
		case R.id.receiverela:
			Intent intent3 = new Intent();
			intent3.setClass(App.ctx, MyOrderActivity.class);
			intent3.putExtra("fragmentCurrent", 3);
			startActivity(intent3);
			break;
		case R.id.customrela:
			Intent intent4 = new Intent();
			intent4.setClass(App.ctx, CustomActivity.class);
			intent4.putExtra("fragmentCurrent", 3);
			startActivity(intent4);
			break;
		case R.id.mywealth:
			Intent intent5 = new Intent();
			intent5.setClass(App.ctx, MyWealthActivity.class);
			startActivity(intent5);
			break;
		case R.id.mylocation:
			Intent intent6 = new Intent();
			intent6.setClass(App.ctx, ManageLocationActivity.class);
			startActivity(intent6);
			break;
		case R.id.mycollect:
			Intent intent7 = new Intent();
			intent7.setClass(App.ctx, MyCollectActivity.class);
			startActivity(intent7);

		default:
			break;
		}

	}

}
